package org.example.demo01;

import java.io.FileInputStream;
import java.io.IOException;

public class Test {
    //1.使用字节流 读取文件的内容并打印输出到控制台 （文件目录：C:/test01/01.txt）
    public static void main(String[] args) {
        try {
            FileInputStream fileInputStream = new FileInputStream("C:\\demo01\\01.txt");
            byte[] buf = new byte[1024];
            int len = 0;
            while ((len = fileInputStream.read(buf)) != -1) {
                System.out.println(new String(buf));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
